package com.supersit.greensproject.resources;

import android.content.Context;

import com.supersit.greensproject.utils.SPUtils;

/**
 * 权限控制
 * Created by Administrator on 2016/8/12 0012.
 */
public class Authority {
    public static int[] getBaseAuthority(Context context) {
        String baseAuthority = (String) SPUtils.get(context, "baseAuthority", "");
        //String baseAuthority = "01234";
        int len = baseAuthority.length();
        int[] Authoritys = new int[len];
        if (len > 0) {
            for (int i = 0; i < baseAuthority.length(); i++) {
                Authoritys[i] = Integer.parseInt(String.valueOf(baseAuthority.charAt(i)));
            }
        }
        return Authoritys;
    }

    public static int[] getMaketAuthority(Context context) {
        String maketAuthority = (String) SPUtils.get(context, "maketAuthority", "");
       // String maketAuthority = "56";
        int len = maketAuthority.length();
        int[] Authoritys = new int[len];
        if (len > 0) {
            for (int i = 0; i < maketAuthority.length(); i++) {
                Authoritys[i] = Integer.parseInt(String.valueOf(maketAuthority.charAt(i)));
            }
        }
        return Authoritys;
    }

    public static int[] getQualityMonitorAuthority(Context context) {
       String baseAuthority = (String) SPUtils.get(context, "qualityMonitoringAuthority", "");
       // String baseAuthority = "01234";
        int len = baseAuthority.length();
        int[] Authoritys = new int[len];
        if (len > 0) {
            for (int i = 0; i < baseAuthority.length(); i++) {
                Authoritys[i] = Integer.parseInt(String.valueOf(baseAuthority.charAt(i)));
            }
        }
        return Authoritys;
    }
}
